﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot0a05
    {
        private int? _um;
		private string _umdesc;
		private string _muser;
		private string _listid;
		
        /// <summary>
        /// 单位代码
        /// </summary>
		public int? Um
		{
			get { return _um;	 }
			set { _um=value;	}
		}
        /// <summary>
        /// 单位名称
        /// </summary>
		public string Umdesc
		{
			get { return _umdesc;	 }
			set { _umdesc=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Pot0a05> GetPot0a05ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot0a05> list = new List<Pot0a05>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot0a05 model = GetPot0a05ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot0a05 GetPot0a05ByDataRow(DataRow dr)
		{
			Pot0a05 model = new Pot0a05(); //实例化Pot0a05
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("um")&&!(dr["um"] is System.DBNull))  
				model.Um = ( int)dr["um"];
			if (dcc.Contains("umdesc")&&!(dr["umdesc"] is System.DBNull))  
				model.Umdesc = ( string)dr["umdesc"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
